
$(function() {
	 

			$.ajax({
                url:basePath+'/index/headMenu.htm',
                type:'post',
                dataType:'json',
                //data:{rootCommentId:rootCommentId,blogId:Number(blogId),replyContent:content,name:name},
                success:function (res) {     
                
				var html = template("categoryMenu",res);
				document.getElementById('nav').innerHTML = html;     
				
				$("li").hover(function() {
									$(".category-content .category-list li.first .menu-in").css("display", "none");
									$(".category-content .category-list li.first").removeClass("hover");
									$(this).addClass("hover");
									$(this).children("div.menu-in").css("display", "block")
								}, function() {
									$(this).removeClass("hover")
									$(this).children("div.menu-in").css("display", "none")
								});
				
               },error:function (e) {                    
                        alert("服务器异常，请稍后重试");
                }
            });
            
            //轮播
            $.ajax({
                url:basePath+'/index/headAd.htm',
                type:'post',
                dataType:'json',
                //data:{rootCommentId:rootCommentId,blogId:Number(blogId),replyContent:content,name:name},
                success:function (res) {   
                var data={
				 	"base_path":basePath,
				 	"file_path":fileHttp,
				 	"jsons":null
				 }
                data.jsons=res;
				var html = template("Adbanner",data);
				document.getElementById('demo-slider-0').innerHTML = html;     
				
				$('.am-slider').flexslider();
			
               },error:function (e) {                    
                        alert("服务器异常，请稍后重试");
                }
            });
            
            //商品推荐
            $.ajax({
                url:basePath+'/index/hotItems.htm',
                type:'post',
                dataType:'json',
                //data:{rootCommentId:rootCommentId,blogId:Number(blogId),replyContent:content,name:name},
                success:function (res) {   
                var data={
				 	"base_path":basePath,
				 	"file_path":fileHttp,
				 	"jsons":null
				 }
                data.jsons=res;
				var html = template("hotItem",data);
				document.getElementById('homeHotItem').innerHTML = html;     
			
               },error:function (e) {                    
                        alert("服务器异常，请稍后重试");
                }
            });            
});

							
						